<style type="text/css">
    .type1 {
        background-color: #fff !important;
    }
    
    .type2 {
        background-color: #ccc !important;
    }
</style>
<div ng-controller="ConfessionCtrl" ng-init="addAction()">
    <ul class="sui-breadcrumb">
        <li><a href="#/confession/list">{{confession_data.name| translate}}</a></li>
        <li class="active">
            {{!confession_activity_id?"创建":"edit"|translate}}
        </li>
    </ul>
    <form name="Tradeform" class="sui-form form-horizontal" novalidate>
        <div mywizard class="sui-steps">
            <step>
                <label><span class="round">1</span><span>活动设置</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <step>
                <label><span class="round">2</span><span>设置商品</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <step>
                <label><span class="round">3</span><span>完成</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <div stepcontent0 class="stepContent">
                <div class="stepbody">
                    <div class="control-group">
                        <label class="control-label v-top">
                            表白标题：
                        </label>
                        <div class="controls">
                            <input id="title" type="text" name="name" ng-model="confession_data.name" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            起始时间：
                        </label>
                        <div class="controls">
                            <input id="start_time" ng-model="confession_data.start_time" datetimepicker name="start_time" value="2017-05-21 12:12:15" required>
                            <span class="float_left" style="width:10px;">至</span>
                            <input id="end_time" ng-model="confession_data.end_time" datetimepicker name="end_time" min-date="{{confession_data.start_time}}" required>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label v-top">
                            表白文案：
                        </label>
                        <div class="controls">
                            <div ng-repeat="(key, value) in confession_data.confession_copy" style="margin-bottom: 10px;">
                                <input id="copy" type="text" class="input-xxlarge" name="copy" ng-model="value.title" />
                                <button class="sui-btn btn-link" ng-click="removeTitle(key)">删除</button>
                            </div>
                            <button class="sui-btn btn-primary" ng-click="addCopy()">+增加文案</button>
                        </div>
                    </div>
                    <div class="control-group" style="width: 100%;">
                        <label class="control-label v-top"> {{'背景图片'| translate}}：</label>
                        <div class="controls">
                            <ul class="sui-row-fluid">
                                <li class="span2" ng-repeat="(key, value) in confession_data.background_img" style="width: 162px;margin-bottom: 10px;">
                                    <div style="width: 162px;">
                                        <img ng-src="{{value.img}}" style="width:600px;height: 170px">
                                    </div>
                                    <label style="display: block;width: 162px;">
                                        <br/> 链接：
                                        <input ng-model="value.img" type="text" name="name" value="" style="width:100px">

                                        <attachment owner-id="key+1" owner-type="item" dhf-ng-model="value.img" xtype="url" mult="false" title="Upload" use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"></attachment>
                                        <button class="sui-btn btn-danger" ng-click="removeBgImg(key)">删除</button>
                                    </label>
                                </li>
                            </ul>
                            <button class="sui-btn btn-primary" style="margin-top: 10px;" ng-click="addImg();">+增加背景图片</button>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label v-top"> {{'文案位置'| translate}}：</label>
                        <div class="controls">
                            左边距：<input id="x" ng-model="confession_data.position1.x" /> 像素
                            <br /><br /> 上边距：
                            <input id="y" ng-model="confession_data.position1.y" /> 像素
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label v-top"> {{'昵称位置'| translate}}：</label>
                        <div class="controls">
                            左边距：<input id="x1" ng-model="confession_data.position1.x1" /> 像素
                            <br /><br /> 上边距：
                            <input id="y1" ng-model="confession_data.position1.y1" /> 像素
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label v-top"> {{'城市位置'| translate}}：</label>
                        <div class="controls">
                            左边距：<input id="x2" ng-model="confession_data.position1.x2" /> 像素
                            <br /><br /> 上边距：
                            <input id="y2" ng-model="confession_data.position1.y2" /> 像素
                        </div>
                    </div>

                    <div id="position" class="control-group zhide" style="width: 100%;">
                        <label class="control-label v-top"> {{'参数配置'| translate}}：</label>
                        <div class="controls">
                            <input type="text" class="input-xlarge" ng-model="confession_data.position" />
                        </div>
                    </div>

                    <span ng-click="showPosition();" style="position: absolute;top: 30px;right: 0px;">.</span>
                </div>
                <div>
                    <button type="button" id="next1" class="sui-btn btn-primary" mywizard-next ng-click="confessionAdd();">{{'Next step'|translate}}</button>
                </div>
            </div>
            <div stepcontent1 class="stepContent">
                <div class="stepbody">
                    <ul id="tab-demo" class="sui-nav nav-tabs nav-primary">
                        <li class="{{total_count?'active':''}}"><a href="#default1" data-toggle="tab" ng-click="tabCut($event);">已参加({{total_count?total_count:chosedItems.length?chosedItems.length:0}})</a></li>
                        <li class="{{!total_count?'active':''}}">
                            <a href="#custom1" data-toggle="tab" ng-click="tabCut($event);choseBroadcast();">添加</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="default1" class="tab-pane {{total_count?'active':''}}">
                            <table class="sui-table table-bordered">
                                <thead>
                                    <tr>
                                        <th>{{"item_image"|translate}} </th>
                                        <th>{{"title"|translate}} </th>
                                        <th>{{"operation"|translate}}</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr ng-repeat="item in item_list">
                                        <td>
                                            <img ng-src="{{item.img}}" class="item-image-80" /></td>
                                        <td>
                                            {{item.title}}
                                            <br> {{item.item_id}}
                                        </td>
                                        <td>
                                            <button class="sui-btn btn-danger" ng-click="confessionItemDelete(item.id,item.confession_activity_id)">删除</button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <pager page-no="1" page-size="pageSize" total="itemsTotal" get-data="confessionItemGet(pageNo)"></pager>
                        </div>
                        <div id="custom1" class="tab-pane {{!total_count?'active':''}}">
                            <choose-item item-check="itemdata(items)" is-chose-item="1" mult="yes" chosed-item="confession_item_list" skushow="1"></choose-item>
                        </div>
                    </div>
                </div>
                <div>
                    <button type="button" class="sui-btn btn-primary" mywizard-previous>上一步</button>
                    <button type="button" class="sui-btn btn-primary" ng-click="chooseItemAdd(confession_activity_id);">保存</button>
                </div>
            </div>
        </div>
    </form>
</div>